package com.puny.mvc.controllers.particle
{
	import com.puny.mvc.models.Model;
	import com.puny.mvc.views.singleviews.ParticleView;
	import com.puny.utils.Random;
	
	import flash.display.Stage;
	import flash.geom.Point;

	internal class SampleWorld implements IWorld
	{
		private const _zero:Point = new Point(0,0);
		private const _gravity:Point = new Point(0,9.8*10);
		public function SampleWorld()
		{
			super();
		}
		
		public function get total():Number {
			return 100;
		}
		
		public function get init():Number {
			return 10;
		}		
		
		public function get increment():Number {
			return 10;
		}
		
		public function get gravity():Point {
			return _gravity;
		}
		
		public function createView(total:Number):ParticleView {
			return new ParticleView("assets/particle.swf", "star", total);
		}
 		
		public function specialInitialize(model:Model):Point {
			model.x = 0;
			model.y = 0;
			return new Point(Random.between(50,1000),Random.between(-1000,0));
		}
		
		public function sumUpAccelaration(model:Model):Point {
			return _zero.clone();
		}
		
		public function isOver(model:Model,stage:Stage):Boolean {
			return model.y > stage.stageHeight + 100;
		}
		
	}
}